#include <func.h>

void exitFunc1(void) {
	printf("Version 1: I am going to die...\n");
}

void exitFunc2(void) {
	printf("Version 2: I am going to die...\n");
}

int main(int argc, char* argv[])
{
	// 注册退出处理函数
	if (atexit(exitFunc1) != 0) {
		error(1, 0, "atexit");
	}
	if (atexit(exitFunc2) != 0) {
		error(1, 0, "atexit");
	}

	printf("BEGIN\n");
	sleep(2);
	printf("END\n");
	
	exit(0);
    return 0;
}

